package com.enki.cigarettes.entity;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author Glory
 * @version 1.0
 * @time 2019-01-23 15:32
 * @Description TODO
 */
@Entity
@Table(name = "user_level_t", schema = "e_cigarettes_shop", catalog = "")
public class UserLevelT {
    private String id;
    private String name;
    private int level;
    private int lvScore;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private Boolean removed;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "level")
    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    @Basic
    @Column(name = "lv_score")
    public int getLvScore() {
        return lvScore;
    }

    public void setLvScore(int lvScore) {
        this.lvScore = lvScore;
    }

    @Basic
    @Column(name = "create_time")
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time")
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "removed")
    public Boolean getRemoved() {
        return removed;
    }

    public void setRemoved(Boolean removed) {
        this.removed = removed;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserLevelT that = (UserLevelT) o;
        return level == that.level &&
                lvScore == that.lvScore &&
                removed == that.removed &&
                Objects.equals(id, that.id) &&
                Objects.equals(name, that.name) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, level, lvScore, createTime, updateTime, removed);
    }
}
